﻿@using GrainManage.Web.Models
@using GrainManage.Web.Resources
@ScriptHelper.Search()
@ScriptHelper.Autocomplete()
<script type="text/javascript">
    $(document).ready(function () {
        var data = { pageIndex: 0, pageSize: 100 };
        BindAutoComplete("/Contact/GetContactName", "#GetContactName", data, true);
        BindAutoComplete("/Contact/GetContactArea", "#GetContactArea", data, true);
        BindAutoComplete("/Contact/GetContactAddress", "#GetContactAddress", data, true);

        $("#search").click(function (event) {
            var name = $("#GetContactName").val();
            var area = $("#GetContactArea").val();
            var address = $("#GetContactAddress").val();
            var pageSize = GetPageSize();
            BindMyPaginationClick("#result", "/Contact/SearchContacts", { name: name, area: area, address: address, pageIndex: 0, pageSize: pageSize });
        });

        $("#search").triggerHandler("click");
    });
</script>
<div id="searchContacts" class="searchCondition">
    <label>@ContactResx.Name</label>
    <input type="text" id="GetContactName" />

    <label>@ContactResx.Area</label>
    <input type="text" id="GetContactArea" />

    <label>@ContactResx.Address</label>
    <input type="text" id="GetContactAddress" />
    @ControlHelper.PageSize()
   @*<button id="search">@PriceResx.SearchRecentPrice</button>*@
    @ControlHelper.Button(ContactResx.SearchContact)
</div>
<div id="result"></div>
<div id="pagination">
    @Html.Partial(GrainManage.Web.Constant.PaginationView)
</div>
